<script type="text/javascript">
$(function(){
	$.get("applicationSingle/getCardInfo",function(data){
		var content="<option value='' selected>请选择</option>";
		var i;
		$(data).each(function(n,item){
			for(i=0;i<item.certificates.length;i++){
				content+="<option value="+item.certificates[i].certificateType+">"
				+item.certificates[i].certificatesName+"</option>"
			}
			$("#agentPapertypeByExchange").html(content);
		});
	},"json");
	$.post("exchangeCard/getExchangeInfo",function(json){
		if(json.statusCode==DWZ.statusCode.error){
			navTabAjaxDone(json)
		}else{
			$(json).each(function(n,item){
				$("input[name='citizenCardNo']",navTab.getCurrentPanel()).val(item.cardNo);
				$("input[name='cardPName']",navTab.getCurrentPanel()).val(item.cardpName);
				$("input[name='ChangeCardFee']",navTab.getCurrentPanel()).val(item.fee);
				$("input[name='customerName']",navTab.getCurrentPanel()).val(item.Card.customerName);
				$("input[name='paperTypeName']",navTab.getCurrentPanel()).val(item.paperType);
				$("input[name='paperNo']",navTab.getCurrentPanel()).val(item.Card.paperNo);
				$("input[name='nationality']",navTab.getCurrentPanel()).val(item.Card.nationality);
				if(item.Card.gender=="01"){
					$("#sex5").attr("checked",true);
				}else{
					$("#sex6").attr("checked",true);
				}
				if(item.Card.prAddrDetailedInfo!=null){
					$("input[name='address']",navTab.getCurrentPanel()).val(item.Card.prAddrDetailedInfo);
				}
				if(item.Card.contactPostalcode!=null){
					$("input[name='postcode']",navTab.getCurrentPanel()).val(item.Card.contactPostalcode);
				}
				if(item.Card.email!=null){
					$("input[name='email']",navTab.getCurrentPanel()).val(item.Card.email);
				}
				$("#isRead").val(item.Card.isRead)
				$("input[name='phone']",navTab.getCurrentPanel()).val(item.Card.homePhone);
				$("input[name='cardTypeName']",navTab.getCurrentPanel()).val(item.Card.cardTypeName);
				$("input[name='cardQualityAssurance']",navTab.getCurrentPanel()).val(item.Card.cardQualityAssurance);
				$("input[name='cellphone']",navTab.getCurrentPanel()).val(item.Card.mobile);
				$("input[name='changeCardDate']",navTab.getCurrentPanel()).val(getDate(item.Card.changeCardDate));
				
				if(item.Card.isRead=="1"){//可读设置当前时间
					$("input[name='getCardDate']",navTab.getCurrentPanel()).val(getDate(Date.now()));
					$("input[name='cardBalance']",navTab.getCurrentPanel()).val(item.blance);
					
				}else{
					$("input[name='getCardDate']",navTab.getCurrentPanel()).val(getDate(item.Card.getCardDate));
					$("#sceneSendCard").attr("hidden",true);
				}

			})
		}
		
	},"json");

});

</script>

<div class="pageContent">
	<form id="commitExchangeInfo" method="post" action="exchangeCard/commitExchangeInfo" class="required-validate" onsubmit="return validateCallback(this,printViewPageAjaxDone);">
		<div class="pageFormContent" layoutH="96"> 
			<fieldset>
			<legend>个人信息</legend>
			
			<p>
				<label>姓名：</label>
				<input  type="text" class="" size="30"name="customerName" readonly="readonly" />		
			</p>
			<p>
				<label>证件类型：</label>
				<input type="text"   name="paperTypeName" size="30" readonly="readonly"/>
			</p>
			<p>
				<label>证件号码：</label>
				<input name="paperNo" class="" type="text" size="30" readonly="readonly" />
			</p>
			 <p>
		        <label>性别：</label>
		        <input id="sex5" type="radio" name="gender" value="01" />男  <input id="sex6" type="radio" name="gender"  value="02"/>女
            </P>
			<p>
				<label>民族：</label>
				<input id="nationality" name="nationality" type="text" size="30" readonly="readonly"/>
			</p>
			<p>
				<label>通讯地址：</label>
				<input type="text" name="address" class="" size="30" readonly="readonly"/>
			</p>
			<p>
				<label>邮政编码：</label>
				<input type="text" name="postcode" class="" size="30" readonly="readonly"/>
			</p>
			<p>
				<label>电子邮箱：</label>
				<input type="text" name="email" class="" size="30" readonly="readonly"/>
			</p>
			<p>
				<label>联系电话：</label>
				<input name="phone" type="text" size="30" readonly="readonly"/>
			</p>
			<p>
				<label>手机：</label>
				<input name="cellphone" type="text" size="30" readonly="readonly"/>
			</p>
			
			</fieldset>
			<fieldset>
			<legend>原卡信息</legend>
			<p>
				<label>卡产品：</label>
				<input  name="cardPName" type="text" size="30" readonly="readonly"/>
			</p> 
			<p>
				<label>卡类型：</label>
				<input  name="cardTypeName" type="text" size="30" readonly="readonly"/>
			</p>
			<p>
				<label>原市民卡号：</label>
				<input name="citizenCardNo"  type="text" size="30" readonly="readonly" />
			</p>
			  <p>
				<label>换卡日期：</label>
				<input name="changeCardDate" type="text" size="30" readonly="readonly"/>
			</p>
			<p>
				<label>领卡日期：</label>
				<input name="getCardDate" type="text" size="30"  readonly="readonly"/>
			</p>
			<p>
				<label>质保期(月)：</label>
				<input name="cardQualityAssurance" type="text" size="30" />
			</p>
			<p>
				<label>是否可读：</label>
				<select id="isRead" name="isRead"   >
				<option value="2">不可读</option>
				<option value="1">可读</option>
				</select>
			</p>
			<p>
				<label>换卡原因：</label>
				<input name="ChangeCardReason" type="text" size="30" maxlength="30" />
			</p>
			<!-- <p>
				<label>电子钱包余额(元)：</label>
				<input name="cardBalance" type="text" size="30"  readonly="readonly"/>
			</p> -->
			<!-- <p>
				<label>换卡收费(工本费)：</label>
				<input name="ChangeCardFee" type="text" size="30" readonly="readonly"/>
			</p> -->
			</fieldset>
			<fieldset>
			<legend>代理人信息</legend>
			<p>
				<label>代理人证件类型：</label>
				<select flag="paperCode" id="agentPapertypeByExchange" name="agentPapertype" >
					
				</select>
			</p>
			<p>
				<label>代理人证件号码：</label>
				<input type="text" size="30" name="agentPaperNo" class="validIdentity"/>
			</p>
			<p>
				<label>代理人姓名：</label>
				<input type="text" size="30" name="agentName" class="validName"/>
			</p>
			<p>
				<label>代理人手机号码：</label>
				<input type="text" size="30" name="agentPhone" class="validMobile"/>
			</p>
			<p>
				<label>备注：</label>
				<input name="desc" type="text" size="30" maxlength="30"/>
			</p>
			</fieldset>
			 <p id="sceneSendCard">
				<label>是否当场领卡：</label>
				<Select name="sceneSendCard" >
					<option value="1">是</option>
					<option value="0">否</option>
				</Select>
			</p>
			
		</div>
		<div class="formBar">
			<ul>
				<li><div class="buttonActive"><div class="buttonContent"><button type="submit" class="valid">提交</button></div></div></li>
				<li>
					<a class="buttonActive" href="exchangeCard/goExchangeCard" target="navTab" rel="exchangeCard" title="换卡"><span>返回</span></a>
				</li>
			</ul>
		</div>
	</form>
</div>
